<%@page import="systems.ConfigSystem"%>
<%@page import="entities.SiteConfig"%>
<%@page import="helpers.LanguageHelper"%>
<%@page import="entities.User"%>
<%@page import="helpers.UrlHelper"%>
<%
SiteConfig siteConfig = ConfigSystem.getConfigs();

String title = (String) request.getParameter("title");
String description = (String) request.getParameter("description");
String keywords = (String) request.getParameter("keywords");
String ogSiteName = (String) request.getParameter("ogsite_name");
String ogTitle = (String) request.getParameter("ogtitle"); 
String ogUrl = (String) request.getParameter("ogurl");
String ogImage = (String) request.getParameter("ogimage");
String ogDescription = (String) request.getParameter("ogdescription");

if (title == null && siteConfig != null)
	title = siteConfig.getTitle();

if (description == null && siteConfig != null)
	description = siteConfig.getMetaDescription();

if (keywords == null && siteConfig != null)
	keywords = siteConfig.getMetaKeywords();

if (ogSiteName == null && siteConfig != null)
	ogSiteName = siteConfig.getSiteName();

if (ogTitle == null && siteConfig != null)
	ogTitle = siteConfig.getTitle();

if (ogDescription == null && siteConfig != null)
	ogDescription = siteConfig.getMetaDescription();

if (ogUrl == null)
	ogUrl = UrlHelper.getServerUrl(request);

if (ogImage == null)
	ogImage = "http://immediatenet.com/t/t_a?Size=1024x768&URL=" + UrlHelper.getDomainServer(request);

User user = (User) request.getAttribute("user_logged_in");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Bootstrap 101 Template</title>
    <!-- Bootstrap -->
    
    <link href="/templates/<%=siteConfig.getTemplate() %>/css/bootstrap.css" rel="stylesheet" media="screen">
    <link href="/templates/<%=siteConfig.getTemplate() %>/css/style.css" rel="stylesheet" media="screen">
    <link href="/templates/<%=siteConfig.getTemplate() %>/css/font-awesome.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Serif">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Boogaloo">
	<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Economica:700,400italic">
    <script src="/templates/<%=siteConfig.getTemplate() %>/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="/templates/<%=siteConfig.getTemplate() %>/js/bootstrap.js" type="text/javascript"></script>
 </head>
<body>
<header>
	<div class="container">
		<div class="row">
			<div class="logo span6">	
				<a class="brand" href="/"><img src="/templates/<%=siteConfig.getTemplate() %>/images/logo.png" alt="logo"></a>
			</div>
			<div class="social-links span6 hidden-phone">		
				<p class="userpanel">
					<% if (user == null) { %>
					<a href="/login" class="google-login"><img src="/templates/<%=siteConfig.getTemplate() %>/images/login_google.png" /></a>
					<% } else { %>
					<i class="icon-user"></i> <a href="/profile/edit">Edit Profile</a> - 
					<i class="icon-list"></i> <a href="/profile/article/list">My Article</a> - 
					<i class="icon-signout"></i> <a href="/logout">Logout</a>
					<% } %>
				</p>
			</div>
		</div>
		
		<div class="row-fluid">
			<div class="navigation"> 
				<div class="navbar navbar-inverse span9">
		    		<div class="navbar-inner">
		          		<a class="btn btn-navbar btnOverlay" data-toggle="collapse" data-target=".nav-collapse">
		            		menu
		          		</a>
		          		<div class="nav-collapse collapse">
		            		<ul class="nav">
								<li><a href="/">Home</a></li>
		              			<li ><a href="/authors">Latest Author</a></li>
		              			<li ><a href="/submit-article">Article Writing</a></li>
		              			<li ><a href="/archives">Archives</a></li>
		              			<li ><a href="/rewrite">Rewrite Article</a></li>
		              			<li ><a href="/contact">Contact</a></li>
		            		</ul>
		          		</div>
		        	</div>
		      	</div>
			
			</div>	
			<!--end: Navigation -->	
				
		</div>
	</div>
</header>

<div id="main">
	<div class="container">